It is known that a determination of an existence of a foreign matter pinched between an opening and closing member and a peripheral member of the opening and closing member is executed in a case where an opening and closing operation of the opening and closing member provided in a door of a vehicle is executed. In this case, the opening and closing member is a window glass. Usually, when a controller for the opening and closing member determines that the foreign matter exists, the controller for the opening and closing member interrupts an opening and closing operation of the opening and closing member and executes another operation that is different from the opening and closing operation to release the foreign matter. Further, for example, the controller for the opening and closing member sets a threshold of a detection value varying according to a load of the window glass and compares the threshold with the detection value to determine whether the foreign matter exists. In this case, for example, the detection value is a rotational speed of a motor rotating to execute the opening and closing operation of the window glass.
However, when an external disturb is generated in a moving of the opening and closing member, the controller for the opening and closing member may erroneously determine that the foreign matter exists without respect to an existence of the foreign matter. In this case, for example, when the door is closed, the controller for the opening and closing member may erroneously determine that the foreign matter exists due to the external disturb generated in a moving of the opening and closing member. JP 2009-74356 A discloses a technology which is developed to avoid the above erroneous determination. According to JP 2009-74356 A, the opening and closing controller corrects the threshold of when the existence of the foreign matter is determined, based on an opening and closing state of the door. Therefore, the erroneous determination can be effectively prevented by considering an error generated due to the opening and closing state of the door.